package main

import (
	"bytes"
	"fmt"
	"net/http"

	"gocv.io/x/gocv"
)

func main(){
	mat := gocv.IMRead("../1.jpeg",gocv.IMReadColor)
	buf, err := gocv.IMEncode(gocv.JPEGFileExt, mat)
	if err != nil {
		fmt.Println(err.Error())
		return 
	}
	reader := bytes.NewReader(buf.GetBytes())
	http.Post("http://localhost:8888/server", "image/jpg",reader )
}